package com.javabase.y2021.m12.day1224;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

/**
 * @descriptions: Client
 * @author: Tom
 * @date: 2021/12/24 下午 05:28
 * @version: 1.0
 */
public class Client {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 30000);
        BufferedReader br = new BufferedReader(
                new InputStreamReader(socket.getInputStream()));
        String line = br.readLine();
        System.out.println("來自Server的數據:" + line);
        // 關閉輸入流,關閉Socket
        br.close();
        socket.close();
    }
}
